
/*    This file is part of the managarm operating system.
 *   Copyright (C) 2007, 2008, 2009  Alexander van der Grinten
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. */

package ast;

import java.util.Iterator;
import java.util.LinkedList;

import org.managarm.jmanacclib.frontend.korona.KorAstNode;

public class AstBlock extends KorAstNode {
	// store sub nodes
	LinkedList<KorAstNode> nodes = new LinkedList<KorAstNode>();
	
	// constructs a new AstFile
	public AstBlock(int line) {
		// invoke the parent constructor
		super(line);
	}
	
	// adds a child node to the file
	public void addChild(KorAstNode node) {
		// add it to the list
		nodes.add(node);
	}
	
	// returns an iterator for child nodes
	public Iterator<KorAstNode> childIter() {
		// return a new iterator
		return nodes.iterator();
	}
}
